import { mapGetters, createNamespacedHelpers} from "vuex"
import {useMapper} from './useCommon'
export function useGetters(moduleName,mapper) {
  let mapperFn = mapGetters
  if (typeof moduleName && moduleName.length > 0) {
    mapperFn = createNamespacedHelpers(moduleName).mapGetters
  } else {
    mapper = moduleName
  }
  return useMapper(mapper, mapperFn)
}